home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’90 / Validate Text Entry / ctlDimItem.f next >
Encoding:
Text File  |  1989-09-28  |  1.1 KB  |  47 lines  |  [TEXT/MPS ]

  1. !!M Inlines.f
  2. !!S Settings
  3.     subroutine ctlDimItem ( theDialog , theItem )
  4.     
  5.     implicit none
  6.     
  7. !!SETC USINGINCLUDES = .FALSE.
  8.     Include    'TYPES.F'
  9.     Include 'QUICKDRAW.F'
  10.     Include 'TEXTEDIT.F'
  11.     Include    'DIALOGS.F'
  12.  
  13.     INCLUDE 'Constants.inc'
  14.     INCLUDE 'common.inc'
  15.  
  16.     integer*2 theItem
  17.     
  18.     Record /DialogRecord/ theDialog
  19.     Pointer /PatPtr/ patHandle
  20.     record /Rect/ box
  21.     integer*4 itemHandle , grayRgn , selRgn
  22.     integer*2 ItemType , index , i
  23.     
  24.     index = theDialog.editField + 2 - SetPointNum !Items are consecutively numbered
  25.     patHandle = GetPattern ( %val(int2(16)) )
  26.     call PenPat ( %val(patHandle^.PPTR) )
  27.     call PenMode ( %val(int2(patBic)) )
  28.     do i = SetPointID , SNPRateID
  29.         if ( ctlBadVal(i) ) then
  30.             if ( i .eq. index ) then
  31.                 grayRgn = NewRgn ()
  32.                 call RectRgn ( %val(grayRgn) , NumBox(i) )
  33.                 selRgn = NewRgn ()
  34.                 call RectRgn ( %val(selRgn) , theDialog.textH.TEH^.TEP^.selRect )
  35.                 call DiffRgn ( %val(grayRgn) , %val(selRgn) , %val(grayRgn) )
  36.                 call PaintRgn ( %val(grayRgn) )
  37.             else
  38.                 call PaintRect ( NumBox(i) )
  39.             end if
  40.         end if
  41.     end do
  42.     call PenNormal
  43.     
  44.     return
  45.     end
  46.  
  47.